package com.bawei.module_message.ui

import com.bawei.module_message.http.MessageApi
import com.bawei.module_message.http.MessageNetModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

class MessageRepository @Inject constructor() {

    @Inject
    @MessageNetModel.CommonMainApi
    lateinit var messageApi: MessageApi


    //帖子列表
    fun getMessage(accessId : String? = null, userId : Int) = flow {
        emit(
            messageApi.getMessage(accessId,userId)
        )
    }.flowOn(Dispatchers.IO)



}






